﻿using System.Collections.Generic;
using NanoERP.Model.Poco;

namespace NanoERP.Model.SystemMgmt
{
    public class ModuleTree : SYS_ModuleType
    {
        private IList<ModuleTree> _children;
        private IList<ModuleModel> _modules;

        public IList<ModuleTree> Children
        {
            get { return _children ?? (_children = new List<ModuleTree>()); }
        }

        public IList<ModuleModel> Modules
        {

            get { return _modules ?? (_modules = new List<ModuleModel>()); }
        }

        public override string ToString()
        {
            return string.Format("{0},C:{1},R:{2}", this.Name, this.Children.Count, this.Modules.Count);
        }

    }
}
